package com.webserver.core;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Arrays;

public class Test {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String name = "范";
        byte[] data = name.getBytes("UTF-8");
        System.out.println(Arrays.toString(data));
        /*
            11101000  e8
            10001100  8c
            10000011  83
         */
        System.out.println(Integer.toBinaryString(-24));
        System.out.println(Integer.toBinaryString(-116));
        System.out.println(Integer.toBinaryString(-125));
        System.out.println(Integer.toHexString(-24));
        System.out.println(Integer.toHexString(-116));
        System.out.println(Integer.toHexString(-125));


        String line = "username=%E8%8C%83%E4%BC%A0%E5%A5%87&password=123456";
        line = URLDecoder.decode(line,"UTF-8");
        System.out.println(line);
    }
}
